inventory = {'rope': 1, 'torch': 6, 'gold coin': 42, 'dagger': 1, 'arrow': 12}
dragonLoot = ['gold coin', 'dagger', 'gold coin', 'gold coin', 'ruby']

def displayInventory(inv):
    total = 0;
    print('Inventory:')
    for k, v in inv.items():
        print(str(v) + ' ' + k)
        total += v
    print('Total number of items: ' + str(total))

def addToInventory(inv, addedItems):
    for i in addedItems:
        inv.setdefault(i, 0)
        inv[i] += 1

addToInventory(inventory, dragonLoot)    
displayInventory(inventory)
